import * as api from "./gw";

export default () => {

  var api = window.api
  //门店编码
  const shopCode = localStorage.getItem('storeCode')
  //门店Id
  const shoreCode = localStorage.getItem('storeCode')
  //门店编码
  const storeCode = localStorage.getItem('storeCode')
  //企业Id
  const enterpriseId = api.njxs_mall_erp_enterpriseid
  //企业编码
  const enterpriseCode = api.enterpriseCode
  //本地模块
  const H5_HOST_URL = api.local_host || 'http://njxs.weilian.cn/shoppingCart'
  //基础模块
  const base_host = api.base_host
  //商品模块
  const goods_host = api.goods_host
  //交易模块
  const trade_host = api.trade_host
  //主页信息模块
  const home_commend = api.home_commend
  //服务模块
  const service_host = api.service_host
  //erp的商品模块
  const njxs_mall_erp_goods_host = api.njxs_mall_erp_goods_host
  //获取购物车相关的配置
  const getConfig = base_host + '/common/selectCommonConfig' + '/' + enterpriseCode
  //获取商品列表
  const goodsList = goods_host + '/mallGoods/queryMallGoodsList'
  //获取加工信息
  const queryProcessList = njxs_mall_erp_goods_host + 'goodsRestApi/getGoodsProcessingServicesInfo'
  //获取分类信息
  const newClassList = goods_host + '/goodsClass/queryGoodsclassInfo'

  //获取商品列表新
  const newGoodsList = goods_host + '/mallGoods/queryMallGoodsListByGoodsClass'

  //获取分类信息
  const classList = goods_host + '/goodsClass/queryGoodsclassInfo?enterprisecode=' + enterpriseCode + '&storeCode=' + shoreCode
  //获取售后订单数量
  const getOrderCount = trade_host + '/orderCanAfterSales/OrderCount'
  //获取可售后订单列表
  const getOrderUrl = trade_host + "/orderCanAfterSales/OrderGoodsList"
  //获取已售后订单列表
  const getSubmitedInfor = service_host + "/afterSales/selectAfterSalesList"
  //分页查找售后列表
  const selectAfterSalesPageList = service_host + '/afterSales/selectAfterSalesPageList'
  //删除购物车内的商品
  const deleteShoppingCart = trade_host + '/shopCart/delete/'
  //添加购物车内的商品
  const addShoppingCart = trade_host + '/shopCart/add'
  //更新购物车信息
  const updateShoppingCart = trade_host + '/shopCart/updateGoodsInfo'
  //获取购物车信息
  const queryShoppingCart = trade_host + '/shopCart/select'
  //在购物车页面内第一次获取购物车内的详情信息
  const queryShoppingCartForCart = trade_host + '/shopCart/getShopCart'
  //删除扫码购购物车的信息
  const scanDeleteShoppingCart = trade_host + '/scanCodeShopCart/delete/'
  //添加商品到扫码购购物车
  const scanAddShoppingCart = trade_host + '/scanCodeShopCart/add'
  //更改扫码购购物车内的商品信息
  const scanUpdateShoppingCart = trade_host + '/scanCodeShopCart/updateGoodsInfo'
  //获取扫码购购物车内的信息
  const scanQueryShoppingCart = trade_host + '/scanCodeShopCart/select'
  //获取扫码购购物车内的信息
  const scanQueryShoppingCartForCart = trade_host + '/scanCodeShopCart/getShopCart'
  //获取已登陆用户的营销中心的优惠信息
  const queryPromotionInfo = trade_host + '/marketCenter/getCalCart/' + shoreCode + '/' + false
  //获取未登陆的优惠信息
  const queryPromotionInfoOffLine = trade_host + '/marketCenter/getCalCartNoLogin'
  //获取扫码购购物车的优惠信息
  const scanQueryPromotionInfo = trade_host + '/marketCenter/getCalScanCodeCart/' + shoreCode + '/' + false
  //获取定期套餐的相关信息
  const queryRegularDetail = trade_host + '/marketCenter/getUsableRegularList/' + enterpriseCode
  //获取定期套餐的相关信息
  const queryFixedDetail = trade_host + '/marketCenter/getFixedPackage/' + enterpriseCode
  //领取线上的优惠券
  const takeDiscount = trade_host + '/marketCenter/receiveCouponCodesOnline'
  //领取线下的优惠券
  const takeDiscountOffLine = trade_host + '/marketCenter/receiveCouponCodesOffline'
  // 生成代付链接
  const payForOthers = trade_host + '/order/getPayAgentUrl'
  //获取代付订单信息
  const pfoOrderMsg = trade_host + '/order/getPayAgentInfo'
  // 获取代付支付号
  const payForOthersOrderNo = trade_host + '/payment/getPayNoH5'
  return {
    getOrderCount,
    getConfig,
    goods_host,
    home_commend,
    enterpriseCode,
    shoreCode,
    shopCode,
    goodsList,
    newGoodsList,
    storeCode,
    classList,
    H5_HOST_URL,
    getOrderUrl,
    getSubmitedInfor,
    enterpriseId,
    deleteShoppingCart,
    addShoppingCart,
    updateShoppingCart,
    queryShoppingCart,
    queryShoppingCartForCart,
    queryPromotionInfo,
    queryPromotionInfoOffLine,
    queryRegularDetail,
    queryFixedDetail,
    takeDiscount,
    scanDeleteShoppingCart,
    scanAddShoppingCart,
    scanUpdateShoppingCart,
    scanQueryShoppingCart,
    scanQueryShoppingCartForCart,
    scanQueryPromotionInfo,
    takeDiscountOffLine,
    selectAfterSalesPageList,
    payForOthers,
    pfoOrderMsg,
    payForOthersOrderNo,
    queryProcessList,
    newClassList
  }
}

